<div class="pac-page-header">
  <div class="w-full flex justify-between items-center">
    <div class="pac-page-title">{{ 'PAC.MENU.MANAGE_ORGANIZATIONS' | translate: {Default: "Manage Organizations"} }}</div>
    
    <div ngmButtonGroup displayDensity="cosy">
      <button mat-raised-button color="primary" displayDensity="cosy" (click)="addOrganization()">
        <mat-icon fontSet="material-icons-outlined" nxDensity="cosy">add</mat-icon>{{ 'PAC.ACTIONS.ADD' | translate: {Default: "Add"} }}
      </button>
    </div>
  </div>

  <nav mat-tab-nav-bar class="pac-tab-nav-bar" color="accent" mat-align-tabs="start" mat-stretch-tabs="false" disableRipple displayDensity="cosy"
    [tabPanel]="tabPanel"
  >
    <span mat-tab-link [routerLink]="['.']"
      routerLinkActive #rla="routerLinkActive"
      [routerLinkActiveOptions]="{exact: true}"
      [active]="rla.isActive"
    >
      {{ 'PAC.ORGANIZATIONS_PAGE.Organization.AllOrganizations' | translate: {Default: "All Organizations"} }}
    </span>

    @for (link of openedLinks(); track link.id) {
      <span mat-tab-link [routerLink]="[link.id]"
        [active]="link.id === currentLink()?.id">
        <mat-icon class="mr-1" fontSet="material-icons-outlined" displayDensity="cosy">face</mat-icon>
        {{ link.name }}
        <button mat-icon-button class="pac-tab-close" displayDensity="compact" (click)="removeOpenedLink(link)">
          <mat-icon>cancel</mat-icon>
        </button>
      </span>
    }
  </nav>
</div>
<mat-divider></mat-divider>

<mat-tab-nav-panel #tabPanel class="pac-page-body flex flex-col items-center"
  [@routeAnimations]="o.isActivated && o.activatedRoute.routeConfig.path">
  <router-outlet #o="outlet"></router-outlet>
</mat-tab-nav-panel>
